import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';
import {createRouter, createWebHashHistory} from 'vue-router';


//制定路由规则

const routes = [
    {
        path:'/',
        name: "main",
        
        component: () => import("@/views/Main.vue"),
        redirect: "/home",
        children: [
            {
                path: "/home",
                name: "home",
                component: ()=> import("@/views/Home.vue")
            },
            {
                path: "/generate",
                name: "generate",
                component: ()=> import("@/views/Generate.vue")
            },
            {
                path: "/upload",
                name: "upload",
                component: ()=> import("@/views/Upload.vue")
            },
            {
                path: "/page1",
                name: "page1",
                component: ()=> import("@/views/Page1.vue")
            },
            {
                path: "/page2",
                name: "page2",
                component: ()=> import("@/views/Page2.vue")
            },
            {
                path: "/user",
                name: "user",
                component: ()=> import("@/views/User.vue")
            },
        ],
    },
    {
        path: "/login",
        name:"login",
        component: () => import("@/views/Login.vue")
    },
    {
        path: "/register",
        name:"register",
        component: () => import("@/views/Register.vue")
    },
];
const router = createRouter({
    history: createWebHashHistory(),
    routes,
});


export default router;